﻿Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnGetSum_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnGetSum.Click
        lblResult.Text = getResult(txtNum1.Text, txtNum2.Text)
    End Sub

    Private Function getResult(ByVal strNum1 As String, ByVal strnum2 As String) As String
        Dim num1, num2, result As Single
        Dim summary, message As String

        num1 = CSng(strNum1)
        num2 = CSng(strnum2)
        result = (num1 + num2)

        summary = ("Answer: ") & result & ("<br/>You Entered the Numbers '") & num1 & ("' and '") & num2 & ("'!<br/>")
        message = ("The Sum of ") & num1 & (" and ") & num2 & (" is ")

        Return summary & message & result
    End Function

    Protected Sub txtNum1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles txtNum1.TextChanged
        lblResult.Text = ""
    End Sub
End Class